package com.yx.changdao.common.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.yx.changdao.common.annotation.AutoFill;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;

/**
 * 账户角色表
 *
 * @author zhangqi
 * @date 2019-11-06 11:21:05
 */
@TableName(SysUserRole.TABLE_NAME)
public class SysUserRole implements Serializable {
    private static final long serialVersionUID = 1L;

    public static final String TABLE_NAME = "sys_user_role";

    /**
     * 登陆账户主键ID
     */
    public static final String USER_ID = "user_id";
    /**
     * 角色ID
     */
    public static final String ROLE_ID = "role_id";
    /**
     * 创建时间
     */
    public static final String CREATE_TIME = "create_time";


    /**
     * 登陆账户主键ID
     */
    @TableId(type = IdType.INPUT)
    @NotEmpty(message = "用户id不能为空")
    @Length(min = 1, max = 32, message = "用户id只能在1~32位之间")
    private String userId;
    /**
     * 角色ID
     */
    @TableId(type = IdType.INPUT)
    @NotEmpty(message = "角色id不能为空")
    @Length(min = 1, max = 32, message = "角色id只能在1~32位之间")
    private String roleId;
    /**
     * 创建时间
     */
    @AutoFill
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;


    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
